package com.ship.dispatch.controller;

import com.ship.common.core.web.domain.JsonResult;
import com.ship.dispatch.bo.SpShipScheduleBO;
import com.ship.dispatch.service.SpShipScheduleService;
import com.ship.dispatch.vo.SpShipScheduleVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/spShipSchedule/")
@Api(value = "disSpShipSchedule", tags = "船舶排期控制器")
public class SpShipScheduleController {
    @Autowired
    private SpShipScheduleService shipScheduleService;

    /**
     * 船舶排期列表
     *
     * @param spShipScheduleBO
     * @return
     */
    @ApiOperation(value = "船舶排期列表")
    @PostMapping("selectShipSchedules")
    public JsonResult<List<SpShipScheduleVO>> selectShipSchedules(@RequestBody SpShipScheduleBO spShipScheduleBO) {
        List<SpShipScheduleVO> shipScheduleVOS = shipScheduleService.selectShipSchedules(spShipScheduleBO);
        return JsonResult.success(shipScheduleVOS);
    }
}
